<?php
/**
 * JsClasses Multiple Backends Edition
 * Rotines Class
 *
 * @copyright  2010 RIA Allegro
 * @license    GNU LGPL
 * @version    1.3.1 (2010-05-24)
 * @author     Vasiliy.Lyalyuk@gmail.com
 * @link       http://linux.ria.ua/JsClasses/
 */
class JsClassesMemcache  extends JsClasses{

    /**
     * Set memcache Connection
     *
     * @var string
     */
    protected $_memcacheConnection;

    /**
     * GET method string variable for Frontend parameters delivery
     *
     * @var string
     */
    protected $_getParamName='JsClassesText';

    /**
     * Set memcache Connection
     *
     * @param string
     */
    public function setMemcacheConnection(&$memcacheConnection) {
        if ($memcacheConnection) {
            $this->_memcacheConnection=$memcacheConnection;
        } else {
            $this->trigger_error('Error: Mamcache object undefined!',E_USER_ERROR);
        }
    }

    /**
     * Set 'GET' method string variable for Frontend parameters delivery
     *
     * @param string
     */
    public function setGetParamName($getParamName) {
    	$this->_getParamName =$getParamName;
    }  

     /**
     * Get 'GET' method string variable for Frontend parameters delivery
     *
     * @param string
     */
    public function getGetParamName() {
    	return $this->_getParamName;
    }     
    
    
    
    /**
     * Method for Memcache faile data loading
     * For Redefine loading methods
     */
    public  function _classesCacheFileContentLoader() {
        return  memcache_get( $this->_memcacheConnection, $this->_getClassesCacheFileName());
    }

    /**
     * Get Cache Classes FileName
     * @return string
     */
    protected function _getClassesCacheFileName() {
        return $this->_jsRewriteFileName . '.' . $this->_classesCacheExt;
     }



}
?>
